<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><{:C('site_name')}></title>
<meta name="keywords" content="<{:C('keyword')}>" />
<meta name="description" content="<{:C('content')}>" />
<link rel="stylesheet" href="<{:STATICS}>/css/bootstrap.min.css" type="text/css" media="all" />
<link rel="stylesheet" href="<{:RES}>/css/admin.css" type="text/css"/>
</head>
<script type="text/javascript" src="<{:STATICS}>/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<{:STATICS}>/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<{:STATICS}>/js/jquery.artDialog.js?skin=aero"></script>
<script type="text/javascript" src="<{:STATICS}>/js/iframeTools.js"></script>
<script type="text/javascript" src="<{:STATICS}>/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="<{:STATICS}>/js/jquery.form.min.js"></script>
<script type="text/javascript" src="<{:RES}>/js/common.js"></script>
<body>
<div class="iframeBox">
	<form id="ajaxForm" action="<{:U('Weixin/save')}>" method="post" class="form-horizontal form-validata">
		<div class="form-group">
			<label class="col-xs-2 control-label" for="name">父菜单</label>
			<div class="col-xs-10">
				<select name="fid" id="fid" class="form-control">
					<option value="0">请选择</option>
					<volist name="menu" id="vo">
					<option value="<{$vo.id}>"><{$vo.name}></option>
					</volist>
				</select>
			</div>
		</div>

		<div class="form-group">
			<label class="col-xs-2 control-label" for="name">类型</label>
			<div class="col-xs-10">
				<select name="type" id="type" class="form-control">					
					<option value="view">跳转URL</option>	
					<option value="click">click事件</option>				
				</select>
			</div>
		</div>

		<div class="form-group" id="divKey" style="display:none">
			<label class="col-xs-2 control-label" for="name">关键词</label>
			<div class="col-xs-10">
				<input type="text"
                class="form-control"
				name="keyword"
				id="keyword"
				data-rule-required="true"
				/>
			</div>
		</div>

		<div class="form-group" id="divUrl">
			<label class="col-xs-2 control-label" for="name">链接地址</label>
			<div class="col-xs-10">
				<input type="text"
                class="form-control"
				name="url"
				id="url"
				data-rule-url="true"
				data-rule-required="true"
				/>
			</div>
		</div>

		<div class="form-group">
			<label class="col-xs-2 control-label" for="name">菜单名称</label>
			<div class="col-xs-10">
				<input type="text"
                class="form-control"
				name="name"
				id="name"
				data-rule-required="true"
				/>
			</div>
		</div>

		<div class="form-group">
			<label class="col-xs-2 control-label" for="name">排序</label>
			<div class="col-xs-10">
				<input type="text"
                class="form-control"
				name="sort"
				id="sort"
				value="1" 
				data-rule-required="true"
				/>
			</div>
		</div>

		<div class="form-group">
			<div class="col-xs-10 col-xs-offset-2">
				<button type="submit" class="btn btn-info">保存</button>
			</div>
		</div>
	</form>
</div>

<script>
	$(function(){
		$('#type').change(function(){
			if ($(this).val()=='click'){
				$("#divKey").show();
				$("#divUrl").hide();
			}else{
				$("#divKey").hide();
				$("#divUrl").show();
			}
		})
	})
</script>
</body>
</html>
